import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/api-rpa/task/list',
  delete = '/api-rpa/task/remove',
  stop = '/api-rpa/task/stop',
  log = '/api-rpa/spider/log',
}


/**
 * 列表接口
 * @param params
 */
export const list = (params) => {
  return defHttp.get({ url: Api.list, params });
};

/**
 * 删除系统
 */
 export const deleteTask = (params, handleSuccess) => {
  return defHttp.delete({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};

/**
 * 删除系统
 */
export const stopTask = (params, handleSuccess) => {
  return defHttp.post({ url: Api.stop, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};

/**
 * 列表接口
 * @param params
 */
export const logDetail = (params) => {
  return defHttp.get({ url: Api.log, params },{isTransformResponse: false});
};